package cn.binarywang.tools.generator.event;

/**
 * <pre>
 * 事件类型枚举
 */
public enum EventTypeEnum {
    /**
     *
     */
    EMAIL(1,  "email","邮箱"),
    /**
     *
     */
    MOBILE(2,  "mobile", "手机号"),

    WECHAT(3,  "wechat", "微信"),

    _unknown(0,  "", "未知");

    private  int code;

    private  String name;
    private  String text;

    public static EventTypeEnum getCode(int code) {
        EventTypeEnum[] elements = EventTypeEnum.values();
        for (EventTypeEnum element : elements) {
            if (element.getCode() == code) {
                return element;
            }
        }
        return _unknown;
    }

    EventTypeEnum(int code, String name, String text) {
        this.code = code;
        this.name = name;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

}
